﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Volo.Abp.Settings;

namespace SanJ.FreeCare.Notifications
{
    public class NotificationSettingValueProvider : SettingValueProvider
    {
        public const string ProviderName = "Notification";

        public override string Name => ProviderName;

        public NotificationSettingValueProvider(ISettingStore settingStore)
            : base(settingStore)
        {
        }

        public override Task<string?> GetOrNullAsync(SettingDefinition setting)
        {
            return SettingStore.GetOrNullAsync(setting.Name, Name, null);
        }

        public override Task<List<SettingValue>> GetAllAsync(SettingDefinition[] settings)
        {
            return SettingStore.GetAllAsync(settings.Select(x => x.Name).ToArray(), Name, null);
        }
    }
}
